/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tutorial.DesignPatterns.Factory.Factory;

import tutorial.DesignPatterns.Factory.Product.Bike;
import tutorial.DesignPatterns.Factory.Product.Car;
import tutorial.DesignPatterns.Factory.Product.Plane;
import tutorial.DesignPatterns.Factory.Product.Vehicle;

/**
 * Un factory este un obiect care creaza alte obiecte(numite Produse)
 * in cazul asta am decis sa folosec VehicleType ca sa determin ce se creaza.
 * Se pot face si alte variante care intern stiu ce sa returneza
 * 
 * @author Boogie
 */
public class VehicleFactory {
    
    public Vehicle createVehicle(VehicleType type){
         switch(type){
            case CAR:
                return new Car();
            case PLANE:
                return new Plane();
            case BIKE:
                return new Bike();
            default:
                return null;
        }
    }
}
